# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=halloy
pkgver=2023.5
pkgrel=0
pkgdesc="Rust graphical IRC client supporting IRCv3.2 capabilities"
url="https://github.com/squidowl/halloy"
# s390x: nix crate
arch="all !s390x"
license="GPL-3.0-or-later"
makedepends="
	cargo
	cargo-auditable
	openssl-dev
	"
source="https://github.com/squidowl/halloy/archive/$pkgver/halloy-$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	local appid="org.squidowl.halloy"

	install -Dm755 target/release/halloy -t "$pkgdir"/usr/bin

	install -Dm644 assets/linux/$appid.desktop \
		-t "$pkgdir"/usr/share/applications
	install -Dm644 assets/linux/$appid.appdata.xml \
		-t "$pkgdir"/usr/share/metainfo
	install -Dm644 assets/linux/$appid.png \
		-t "$pkgdir"/usr/share/icons/hicolor/128x128/apps
}

sha512sums="
904aba7b646ad4e224dfcee07ed78d13d6d5a3b96574322314c087ba0c1bc7ae52e85f92a75037b72def13c90e51e6a2d6e124bd2b80d49b993238e3e3afaf48  halloy-2023.5.tar.gz
"
